package org.huanglei.account.view;

import org.huanglei.account.MyApplication;
import org.huanglei.account.R;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;

/**
 * 程序启动加载项
 * @author chenyanfang
 *
 */
public class SplashActivity extends Activity{
	
	private final int SPLASH_DISPLAY_LENGHT = 3000; //延迟三秒 
    
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	
        super.onCreate(savedInstanceState);
        
        MyApplication.getInstance().addActivity(this);
        
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.splash);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
        		WindowManager.LayoutParams.FLAG_FULLSCREEN);
        
        new Handler().postDelayed(new Runnable(){
        	 
            @Override
            public void run() {
                Intent mainIntent = new Intent(SplashActivity.this,DashboardActivity.class);
                SplashActivity.this.startActivity(mainIntent);
                SplashActivity.this.finish();
            }
              
           }, SPLASH_DISPLAY_LENGHT);        
    }
    
}
